from selenium import webdriver
import time

driver = webdriver.Chrome()
driver.get('https://www.baidu.com')

# print(driver.find_element_by_css_selector('.fm').get_attribute('outerHTML'))
# print(driver.find_element_by_css_selector('#kw').get_attribute('outerHTML'))
list = driver.find_elements_by_id('kw')
for i in list:
    print(i.get_attribute('outerHTML'))

print(driver.find_element_by_css_selector('#form span').get_attribute('outerHTML'))
print(driver.find_element_by_css_selector('#form>span').get_attribute('outerHTML'))





driver.quit()